package com.sh.data.engine.application.model.request.datadev;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @author: zigui.zdf
 * @description:
 * @date: 2021/6/2 17:55
 */
@Data
@Schema
public class FlinkNodeBaseRequest {

    @Schema(description = "id，编辑时传入")
    private Long id;

    @Schema(description = "父节点id")
    private Long pid;

    @Schema(description = "类型,0-dir 1-FLINK-SQL 3-FLINK 4-函数 5-资源")
    @NotNull(message = "任务类型不能为空")
    private Integer nodeType;

    @Schema(description = "类型不能为空1-实时开发 2-资源管理 3-函数管理")
    @NotNull(message = "类型不能为空1-实时开发 2-资源管理 3-函数管理")
    private Integer type;

    @Schema(description = "名称")
    @NotBlank(message = "名称不能为空")
    @Length(min = 2, max = 64, message = "名称长度为2-64个字符")
    @Pattern(regexp = "[a-zA-Z0-9_\\u4e00-\\u9fa5]+", message = "名称支持中文、字母、数字、下划线")
    private String name;

    @Schema(description = "资源节点id")
    private Long resourceNodeId;

    @Schema(description = "mainClass路径")
    private String mainClass;
}
